#pragma once

#include <MCF/Code/StdMCF.hpp>
#include <MCF/Code/TabControlClass.hpp>

class TabSDCardClass sealed : public MCF::TabDialogBaseClass {
private:
	static const std::size_t _SECTOR_SIZE = 0x200;
private:
	static bool _ThreadEventGUIInitializeProc(std::intptr_t nContext, std::intptr_t nArg1, std::intptr_t nArg2, std::intptr_t nArg3);
private:
	BYTE _m_arbySnapshotData[_SECTOR_SIZE];
	DWORD _m_dwSectorNumber;
	MCF::TString _m_strSnapshotErrorText;
public:
	TabSDCardClass(HWND hParent);
	virtual ~TabSDCardClass();
protected:
	virtual void _PostSubclass() override;
	virtual void _PreUnsubclass() override;

	virtual bool _OnInitDialog(HWND hDefControl, LPARAM lInitParam) override;
	virtual bool _OnCommand(WORD wNotifyCode, int nControlID, HWND hSender) override;
private:
	void _RefreshSnapshotText();

	void _ClearSnapshot();
	void _DoSnapshot(DWORD dwSectorNumber);

	void _CheckSectorNumberBoxText();
	void _CommandSnapshot();
};
